const path = require("path");

function getPathOutput(){
  return path.join(__dirname,"..","gitcourse-maker2", "webview");
}

module.exports = {
  devtool:'eval-source-map',
  mode: "development",
  entry: {
    "index.js":path.join(__dirname,"src", "index.js"),
  },
  output: {
    path: getPathOutput(),
    filename: "[name]",
    publicPath: '/',
  },
  module: {
    rules: [
      {
        test: /\.html$/,
        use: [
          "html-loader"
        ]
      },
      {
        test: /\.(js|jsx)$/,
        exclude: /node_modules/,
        use: [
          {
            loader: "babel-loader",
            options: {
              presets: ["@babel/preset-env", "@babel/preset-react"],
              plugins: [
                "@babel/plugin-proposal-class-properties",
                // ['react-html-attrs'],
                // ['import', { libraryName: '@fluentui', style: 'css' }],
                
              ],
              compact: true,
            }
          }
        ]
      },
      {
        test: /\.css$/,
        use: [
          'css-loader'
        ],
      },
    ]
  },
  devServer: { contentBase: "./",port:3000},
  watch: true
};